/* ************************************************************************

   Copyright:

   License:

   Authors:

************************************************************************ */

/* ************************************************************************



************************************************************************ */

/**
* This class represents a mapscript colorObj class.
*
* @param red {Integer} Red color value [0-255].
* @param green {Integer} Green color value [0-255].
* @param blue {Integer} Blue color value [0-255].
* @param pen {Integer} Pen, not sure what this does; don't use it.
*/
qx.Class.define("mmclient.mapscript.ColorObj",
{
  extend : qx.core.Object,


  /*
  *****************************************************************************
     CONSTRUCTOR
  *****************************************************************************
  */

  construct : function(red, green, blue, pen) {
    qx.core.Object.call(this);
  },


  /*
  *****************************************************************************
     PROPERTIES
  *****************************************************************************
  */

  properties :
  {
    /**
    * Blue component of color in range [0-255].
    *
    */
    blue :
    {
      check : "Number",
      init : 0
    },

    /**
    * Green component of color in range [0-255].
    *
    */
    green :
    {
      check : "Number",
      init : 0
    },

    /**
    * Red component of color in range [0-255].
    *
    */
    red :
    {
      check : "Number",
      init : 0
    },

    /**
    * Don't mess with this unless you know what you are doing!
    *
    */
    pen :
    {
      check : "Number",
      init : -4
    }
  },


  /*
  *****************************************************************************
     MEMBERS
  *****************************************************************************
  */

  members :
  {
    /**
     * Set all three RGB components. Returns MS_SUCCESS or MS_FAILURE.
     *
     * @type member
     * @param red {Integer} Red color value [0-255].
     * @param green {Integer} Green color value [0-255].
     * @param blue {Integer} Blue color value [0-255].
     * @return {void} 
     */
    setRGB : function(red, green, blue)
    {
      this.setRed(red);
      this.setGreen(green);
      this.setBlue(blue);
    },

    /**
     * Set the color to values specified in case-independent hexadecimal notation.
     * Calling setHex('#ffffff') assigns values of 255 to each color component.
     * Returns MS_SUCCESS or MS_FAILURE.
     *
     * @type member
     * @param hexcolor {String} The hex-value of a color, for example: "#FF0000" is red.
     * @return {void} 
     */
    setHex : function(hexcolor) {},

    // Need to write Hex to RGB conversion code.
    /**
     * Complement to setHex, returning a hexadecimal representation of the color components.
     *
     * @type member
     * @return {void} 
     */
    toHex : function() {}
  }
});
